


//
//  WXUntils.m
//  GoldBook
//
//  Created by wmz on 2021/8/26.
//  Copyright © 2021 wmz. All rights reserved.
//

#import "WXUntils.h"

@implementation WXUntils

+ (BOOL)booWeixin{
    // 判断是否安装微信
    if ([WXApi isWXAppInstalled] ){
        //判断当前微信的版本是否支持OpenApi
        if ([WXApi isWXAppSupportApi]) {
            return YES;
        }else{
              PostInfo(@"请升级微信至最新版本！");
            return NO;
        }
    }else{
        PostInfo(@"请安装微信客户端");
        return NO;
    }
}

+ (PayReq*)wxPayDic:(NSDictionary*)mDic{
    PayReq *request = [[PayReq alloc] init];
    request.partnerId = mDic[@"partnerid"];
    request.package = mDic[@"package"];
    request.prepayId= mDic[@"prepayid"];;
    request.nonceStr= [mDic objectForKey:@"noncestr"];
    request.timeStamp=  [[mDic objectForKey:@"timestamp"] intValue];
    request.sign= [mDic objectForKey:@"sign"];
    return request;
}
@end
